﻿@model SearchModel
@using Nop.Plugin.Misc.FacebookShop.Models;
@using Nop.Plugin.Misc.FacebookShop.Extensions;
@{
    Layout = "~/Plugins/Misc.FacebookShop/Views/MiscFacebookShop/Layout.cshtml";
}
<div class="page search-page">
    <div class="page-title">
        <h1>@T("Search")</h1>
    </div>
    <div class="page-body">
        <div class="search-input">
            @using (Html.BeginRouteForm("Plugin.Misc.FacebookShop.ProductSearch", FormMethod.Get))
            {
                <div class="inputs">
                    @Html.TextBoxFor(model => model.Q, new { @class = "search-text" })
                </div>
                <div class="buttons">
                    <input type="submit" class="button-1 search-button" value="@T("Search")" />
                </div>
                if (!String.IsNullOrEmpty(Model.Warning))
                {
                <strong class="warning">
                    @Model.Warning
                </strong>
                }
            }
        </div>
        <div class="search-results">
            @if (Model.NoResults)
            {
                <strong class="result">
                    @T("Search.NoResultsText")
                </strong>
            }
            @if (Model.Products.Count > 0)
            {
                <div class="product-grid">
                    @foreach (var product in Model.Products)
                    {
                        <div class="item-box">
                            @Html.Partial("~/Plugins/Misc.FacebookShop/Views/MiscFacebookShop/ProductBox.cshtml", product)
                        </div>
                    }
                </div>
            }
            <div class="pager">
                @Html.Pager(Model.PagingFilteringContext).QueryParam("pagenumber").BooleanParameterName("as").BooleanParameterName("isc").BooleanParameterName("sid")
            </div>
        </div>
    </div>
</div>
